package com.practicesuite.systemlayer;

import java.util.Date;
import java.text.DateFormat;
import java.text.SimpleDateFormat;

/**
 * This will be the base user class from which all other classes will be derived
 * @author Ronald Brown
 *
 */
public class User implements UserInterface  {
	
	//Private Variables
	private String name;
	private int eUID;
	private int userID;
	private Date dateOfBirth;
	private String address;
	private String phoneNumber;
	private String gender;
	private String emailAddress;
	private int age;
	private boolean suspended;
	
	public String getEmailAddress() {
        return emailAddress;
    }

    public void setEmailAddress(String emailAddress) {
        this.emailAddress = emailAddress;
    }

    public boolean isSuspended() {
        return suspended;
    }

    public void setSuspended(boolean suspended) {
        this.suspended = suspended;
    }

    /**
	 * Default constructor
	 */
	public User() {
		//TODO: pass default parameters to consructor
	}
	
	/**
	 * Overloaded Contructor.  Use this if user already exists
	 * @param name
	 * @param eUID
	 * @param userID
	 * @param dateOfBirth
	 * @param address
	 * @param phoneNumber
	 * @param gender
	 * @param age
	 * @param suspended
	 */
	public User(String name, int eUID, int userID, Date dateOfBirth, String address, String phoneNumber, 
			String gender, int age, String emailAddress, boolean suspended) {
		
		this.name = name;
		this.eUID = eUID;
		this.userID = userID;
		this.dateOfBirth = dateOfBirth;
		this.address = address;
		this.phoneNumber = phoneNumber;
		this.emailAddress = emailAddress;
		this.suspended = false;
		this.age = age;
		this.gender = gender;
		this.suspended = suspended;
	}

	//Getters and Setters
	/* (non-Javadoc)
	 * @see com.practicesuite.systemlayer.UserInterface#getName()
	 */
	@Override
	public String getName() {
		return name;
	}

	/* (non-Javadoc)
	 * @see com.practicesuite.systemlayer.UserInterface#setName(java.lang.String)
	 */
	@Override
	public void setName(String name) {
		this.name = name;
	}

	/* (non-Javadoc)
	 * @see com.practicesuite.systemlayer.UserInterface#geteUID()
	 */
	@Override
	public int getEUID() {
		return eUID;
	}

	/* (non-Javadoc)
	 * @see com.practicesuite.systemlayer.UserInterface#seteUID(int)
	 */
	@Override
	public void setEUID(int eUID) {
		this.eUID = eUID;
	}

	/* (non-Javadoc)
	 * @see com.practicesuite.systemlayer.UserInterface#getUserID()
	 */
	@Override
	public int getUserID() {
		return userID;
	}

	/* (non-Javadoc)
	 * @see com.practicesuite.systemlayer.UserInterface#setUserID(int)
	 */
	@Override
	public void setUserID(int userID) {
		this.userID = userID;
	}

	/* (non-Javadoc)
	 * @see com.practicesuite.systemlayer.UserInterface#getDateOfBirth()
	 */
	@Override
	public Date getDateOfBirth() {
		return dateOfBirth;
	}

	/* (non-Javadoc)
	 * @see com.practicesuite.systemlayer.UserInterface#setDateOfBirth(java.util.Date)
	 */
	@Override
	public void setDateOfBirth(Date dateOfBirth) {
		this.dateOfBirth = dateOfBirth;
	}

	/* (non-Javadoc)
	 * @see com.practicesuite.systemlayer.UserInterface#getAddress()
	 */
	@Override
	public String getAddress() {
		return address;
	}

	/* (non-Javadoc)
	 * @see com.practicesuite.systemlayer.UserInterface#setAddress(java.lang.String)
	 */
	@Override
	public void setAddress(String address) {
		this.address = address;
	}

	/* (non-Javadoc)
	 * @see com.practicesuite.systemlayer.UserInterface#getPhoneNumber()
	 */
	@Override
	public String getPhoneNumber() {
		return phoneNumber;
	}

	/* (non-Javadoc)
	 * @see com.practicesuite.systemlayer.UserInterface#setPhoneNumber(java.lang.String)
	 */
	@Override
	public void setPhoneNumber(String phoneNumber) {
		this.phoneNumber = phoneNumber;
	}

	/* (non-Javadoc)
	 * @see com.practicesuite.systemlayer.UserInterface#getGender()
	 */
	@Override
	public String getGender() {
		return gender;
	}

	/* (non-Javadoc)
	 * @see com.practicesuite.systemlayer.UserInterface#setGender(java.lang.String)
	 */
	@Override
	public void setGender(String gender) {
		this.gender = gender;
	}

	/* (non-Javadoc)
	 * @see com.practicesuite.systemlayer.UserInterface#getAge()
	 */
	@Override
	public int getAge() {
		return age;
	}

	/* (non-Javadoc)
	 * @see com.practicesuite.systemlayer.UserInterface#setAge(int)
	 */
	@Override
	public void setAge(int age) {
		this.age = age;
	}
	
	public void setEmail(String emailAddress) {
	    this.emailAddress = emailAddress;
	}
	public String getEmail() {
	    
	    return this.emailAddress;
	}

    @Override
    public String toString() {
        DateFormat df = new SimpleDateFormat("MM/dd/yyyy");
        return "User [name=" + name + ", eUID=" + eUID + ", userID=" + userID
                + ", dateOfBirth=" + df.format(dateOfBirth) + ", address=" + address
                + ", phoneNumber=" + phoneNumber + ", gender=" + gender
                + ", age=" + age + "]";
    }
	

}
